<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>面试题</title>
</head>
<body>


<script type="text/javascript">
    /*
        测试题 1：先执行变量提升，再执行函数提升
            var     a
            function a
            typeof a == function
    */
    function a(){}
    var a 
    console.log(typeof a)  // 'function'

    /*
        测试题 2：
    */
    if (!(b in window)){
        var b = 1
    }
    console.log(b)  // undefined

    /*
        测试题 3：
    */

    var c = 1 
    function c(c){
        console.log(c) 
    }
    c(2)  // 报错

    var c      //  ↑ 相当于
    function c(c){
        console.log(c)
    }
    c = 1
    c(2)
</script>
</body>
</html>